function [status, scheduledTargets] = BsMf_Schedule(PQ, sensor1TargetOrder, sensor2TargetOrder, param)
%BsMf_Schedule Summary of this function goes here
%   Detailed explanation goes here

% Initialise variables
scheduledTargets = [];
status = 0;

if isempty(PQ) || isempty(sensor1TargetOrder) || isempty(sensor2TargetOrder)
  % error in inputs, nothing to do.
  return;
end

if (PQ_Size(PQ) == 1)
  scheduledTargets = PQ(:,1);
  status = 1;
  return;
end

PQ = PQ_Sort(PQ);

% Schedule the sensors
if strcmp(param.schedule.algorithm, 'IA')
  [PQ, status, scheduledTargets] = BsMf_Schedule_IntervalAlgebra(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'IH')
  [PQ, status, scheduledTargets] = BsMf_Schedule_IntervalAlgebra_Hogge(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'IG')
  [PQ, status, scheduledTargets] = BsMf_Schedule_IntervalAlgebra_Grow(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'IS')
  [PQ, status, scheduledTargets] = BsMf_Schedule_IntervalAlgebra_SCP(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'IM')
  [PQ, status, scheduledTargets] = BsMf_Schedule_IntervalAlgebra_SCP_Matrix(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'IP')
  [PQ, status, scheduledTargets] = BsMf_Schedule_IntervalAlgebra_SCP_Parallel(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'GS')
  [PQ, status, scheduledTargets] = BsMf_Schedule_GRASP(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'G2')
  [PQ, status, scheduledTargets] = BsMf_Schedule_GRASP2(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'SC')
  [PQ, status, scheduledTargets] = BsMf_Schedule_SCP(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'SA')
  [PQ, status, scheduledTargets] = BsMf_Schedule_SCP_All(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'SG')
  [PQ, status, scheduledTargets] = BsMf_Schedule_SCP_GRASP(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
elseif strcmp(param.schedule.algorithm, 'HA')
  [PQ, status, scheduledTargets] = BsMf_Schedule_Heuristic_Ambiguous(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
else %if strcmp(param.schedule.algorithm, 'HR')
  [PQ, status, scheduledTargets] = BsMf_Schedule_Heuristic(PQ, sensor1TargetOrder, sensor2TargetOrder, param);
end

%scheduledTargets = scheduledTargets';
end